package pattern.decorator;

/*
 * @author changfei
 * @date  2023/11/28 15:22
 * @description
 */
public class FireRice {

    public String desc() {
        return "米饭";
    }

    public int price() {
        return 5;
    }


    public static void main(String[] args) {
        FireRice fireRice = new FireRice();
        System.out.println(String.format("描述:%s,价格%d",fireRice.desc(),fireRice.price()));
        fireRice = new Egg(fireRice);
        System.out.println(String.format("描述:%s,价格%d",fireRice.desc(),fireRice.price()));
        fireRice = new Egg(fireRice);
        System.out.println(String.format("描述:%s,价格%d",fireRice.desc(),fireRice.price()));
        fireRice = new Ham(fireRice);
        System.out.println(String.format("描述:%s,价格%d",fireRice.desc(),fireRice.price()));
    }

}
